<%--
  Created by IntelliJ IDEA.
  User: 老头
  Date: 2023/3/13
  Time: 22:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="/BookStore/client/resources/css/menu_search.css" type="text/css"/>
    <script type="text/javascript">
        //检查有没有登录
        function find() {
            console.log("<%=session.getAttribute("username")%>")
            if ("<%=session.getAttribute("username")%>" != "null") {
                let input = document.getElementById("myInput");
                let val = input.value;
<%--                <%=session.setAttribute("page", 0)%>--%>
<%--                <%=session.setAttribute("pageSize", 3)%>--%>
                window.location.href = "${pageContext.request.contextPath}/MenuSearchServlet?text=" + val + "&page=0&pageSize=3";
            } else {
                alert("没有登录！");
            }
        }
    </script>
</head>
<body>
<div id="navigation_box">
    <div id="navigation_box_inner">
        <ur>
            <li><a href="">文学</a></li>
            <li><a href="">生活</a></li>
            <li><a href="">计算机</a></li>
            <li><a href="">外语</a></li>
            <li><a href="">经管</a></li>
            <li><a href="">励志</a></li>
            <li><a href="">社科</a></li>
            <li><a href="">学术</a></li>
            <li><a href="">少儿</a></li>
            <li><a href="">艺术</a></li>
            <li><a href="">原版</a></li>
            <li><a href="">科技</a></li>
            <li><a href="">考试</a></li>
            <li><a href="">生活百科</a></li>
            <li><a href="${pageContext.request.contextPath}/MenuSearchServlet"><span id="all_goods">全部商品目录</span></a></li>
        </ur>
    </div>
</div>
<div id="navigation_box_down">
<%--    <form action="${pageContext.request.contextPath}/MenuSearchServlet?username="+<%=session.getAttribute("username")%> method="get">--%>
        <div id="navigation_box_down_inner">
            <ul>
                <li>Search</li>
                <li><input id="myInput" type="text" name="text" placeholder="请输入书名"></li>
                <li><input type="image" src="/BookStore/client/resources/images/serchbutton.gif" alt="./resources/images/serchbutton.gif" onclick="find()"></li>
            </ul>
        </div>
<%--    </form>--%>

</div>
</body>
</html>
